package terra.network.packet.server;

import org.jboss.netty.buffer.ChannelBuffer;

import terra.network.packet.Packet;

public class WeatherInfo extends Packet {
 
	public int id;
	public float intensity;
	public float light;
	
	public WeatherInfo() {
	}

	@Override
	public ChannelBuffer toBuffer() {
		ChannelBuffer buf = getNewBuffer();
		buf.writeByte(getId());
		buf.writeInt(id);	
		buf.writeFloat(intensity);
		buf.writeFloat(light);			
		return buf;
	}

	@Override
	public Packet fromBuffer(ChannelBuffer buf) {
		id = buf.readInt();
		intensity = buf.readFloat();
		light = buf.readFloat();
		return this;
	}

	@Override
	public int getLength() {
		return 13;
	}

	@Override
	public boolean isDynamicLength() {
		return false;
	}

	@Override
	public byte getId() {
		return 32;
	}
	
	@Override
	public byte getPriority() {
		return PRIOR_NORMAL;
	}

}
